home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / dos / allocdosobject.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  2KB  |  78 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: allocdosobject.c,v 1.3 1996/08/13 13:52:44 digulla Exp $
  4.     $Log: allocdosobject.c,v $
  5.     Revision 1.3  1996/08/13 13:52:44  digulla
  6.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  7.     Replaced __AROS_LA by __AROS_LHA
  8.  
  9.     Revision 1.2  1996/08/01 17:40:47  digulla
  10.     Added standard header for all files
  11.  
  12.     Desc:
  13.     Lang: english
  14. */
  15. #include <exec/memory.h>
  16. #include <clib/exec_protos.h>
  17. #include <dos/exall.h>
  18. #include <utility/tagitem.h>
  19. #include "dos_intern.h"
  20.  
  21. /*****************************************************************************
  22.  
  23.     NAME */
  24.     #include <clib/dos_protos.h>
  25.  
  26.     __AROS_LH2(APTR, AllocDosObject,
  27.  
  28. /*  SYNOPSIS */
  29.     __AROS_LHA(ULONG,            type, D1),
  30.     __AROS_LHA(struct TagItem *, tags, D2),
  31.  
  32. /*  LOCATION */
  33.     struct DosLibrary *, DOSBase, 38, Dos)
  34.  
  35. /*  FUNCTION
  36.     Creates a new dos object of a given type.
  37.  
  38.     INPUTS
  39.     type - object type.
  40.     tags - Pointer to taglist array with additional information.
  41.  
  42.     RESULT
  43.     Pointer to new object or NULL.
  44.  
  45.     NOTES
  46.  
  47.     EXAMPLE
  48.  
  49.     BUGS
  50.  
  51.     SEE ALSO
  52.  
  53.     INTERNALS
  54.  
  55.     HISTORY
  56.     29-10-95    digulla automatically created from
  57.                 dos_lib.fd and clib/dos_protos.h
  58.  
  59. *****************************************************************************/
  60. {
  61.     __AROS_FUNC_INIT
  62.     __AROS_BASE_EXT_DECL(struct DosLibrary *,DOSBase)
  63.  
  64.     switch(type)
  65.     {
  66.     case DOS_FILEHANDLE:
  67.         return AllocMem(sizeof(struct FileHandle),MEMF_CLEAR);
  68.     case DOS_FIB:
  69.         return AllocMem(sizeof(struct FileInfoBlock),MEMF_CLEAR);
  70.     case DOS_EXALLCONTROL:
  71.         return AllocMem(sizeof(struct ExAllControl),MEMF_CLEAR);
  72.     case DOS_CLI:
  73.         return AllocMem(sizeof(struct CommandLineInterface),MEMF_CLEAR);
  74.     }
  75.     return NULL;
  76.     __AROS_FUNC_EXIT
  77. } /* AllocDosObject */
  78.